// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from '../router'
import axios from 'axios'//引入axios


//2.1导入vue-resource 用于数据请求
import VueResource from 'vue-resource'
//2.2安装Vue-resourse
Vue.use(VueResource)

//全局设置请求的根路径
Vue.http.options.root="http://www.liulongbin.top:3005"

//导入格式化时间的插件
import moment from 'moment'
//全局设置过滤器
Vue.filter('dataFormat',function(dataStr,pattern="YYYY--MM--DD HH:mm:ss"){
	return moment(dataStr).format(pattern)
})

//按需引入mint-ui
import { Header,Swipe, SwipeItem, Button} from 'mint-ui';

Vue.component(Header.name, Header)
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name, Button);

import 'mint-ui/lib/style.css';    


// 导入 MUI 的样式
import './lib/mui/css/mui.min.css'
// 导入扩展图标样式
import './lib/mui/css/icons-extra.css'







const server = axios.create({
baseURL: '/api'
})

Vue.prototype.$axios = server;///把axios挂载到vue上


axios.defaults.headers.post['Content-Type']='application/x-www-form-urlencoded';

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  axios,
  components: { App },
  template: '<App/>'
})
